<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<div id="errorResultDiv" >
<!-- #INVALID -->	
	<table style="width: 100%" class="msgLayout">
		<tr>
		    <td height="20" style="padding-left: 10px;background-color: #eee;">แจ้งเตือน</td>
	    </tr>
	    <tr>
		    <td >
		    	<div class="msgError">
					<table style="padding: 5px;" style="width: 100%">
						<tr height="100%" valign="top">
							<td>
								<table>
			        				<tr>
			        					<td width="100%" valign="top" align="left"  background="/kbond/images/handleException.jpg" class="textError" >
			        						<div class="textError" style="padding: 20pt;">
			        							<table>
			        								<tr>
			        								 	<td>
			        										<img src="../images/blog-error.png" border="0" height="30"></div>
			        								 	</td>
			        								 	<td valign="middle" >
			        								 		 Application Error. (Can not Connect to Server, please try again later.)
			        								 	</td>
			        								</tr>
			        							</table>
			        						</div>
			        						<div class="textError" style="padding-left: 20pt">An error has occurred.Technical details for support personnel are provided below.</div>
			        						<div class="textError" style="padding-left: 20pt">Please try one of the following options:</div>
			        						<br>
			        						<br>
			        						<div class="textError" style="padding-left: 20pt"><a href="#" onclick="window.location.reload(false)">Refresh current screen</a></div>
			        						<%-- <br><div class="textError" style="padding-left: 20pt"><a href="<%=request.getContextPath() %>/pages/Profile_viewProfile.action" >Home page</a></div> --%>
			        						<br><div class="textError" style="padding-left: 20pt"><a href="<%=request.getContextPath() %>/logout/Logout.action">Logout</a></div>
			        						<br>
			        						<br>
			        						<br>
			        						<div><a href="#" onclick="openDetailError()" class="textError">Detail Error</a>
											</div>
											<div id="errorP" style="display: none;">
											<h2>An unexpected error has occurred</h2>
											  <p>
											    Please report this error to your system administrator
											    or appropriate technical support personnel.
											    Thank you for your cooperation.
											  </p>
											  
											  <hr/>
											  <h3>Error Message</h3>
											    <s:actionerror/>
											    <p>
											      <s:property value="%{exception.message}"/>
											    </p>
											    <hr/>
											    <h3>Technical Details</h3>
											    <p>
											      <s:property value="%{exceptionStack}" />
											      <% System.out.println(request.getAttribute("exceptionStack").toString()); %>
											    </p>
											</div>
											<script type="text/javascript">
											var mode = 0;
											function openDetailError(){
												if(mode == 0){
													document.getElementById("errorP").style.display = '';
													mode = 1;
												}else {
													mode = 0;
													document.getElementById("errorP").style.display = 'none';
												}
											}
											</script>
														        						
			        					</td>
			        				</tr>
			        			</table>
							</td>
						</tr>
					</table>
				</div>
		    </td>
	    </tr>
    </table>
</div>
